package com.example.rpAdapter.web;


import com.example.common.annotation.ResponseResult;
import com.example.rpclient.api.IAcceptPrizeService;
import com.example.rpclient.dto.AcceptPrizeAddCmd;
import com.example.rpclient.dto.data.AcceptPrizeVo;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;


@Slf4j
@AllArgsConstructor
@ResponseResult
@RequestMapping("/v1/acceptPrize")
public class AcceptPrizeController {

    private final IAcceptPrizeService acceptPrizeService;


    @PostMapping("/add")
    public AcceptPrizeVo add(@Validated @RequestBody AcceptPrizeAddCmd cmd) {
        return acceptPrizeService.add(cmd);
    }

    @GetMapping("/one")
    public AcceptPrizeVo one(@RequestParam("recordId") Long recordId) {
        return acceptPrizeService.one(recordId);
    }

}
